package cn.tedu.micro.demo.rabbitmq.amqp;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Properties;

@Repository
public class ProducerRepository<T> {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    //自定义 直接发送业务对象
    public void send(T message,String destination){
        rabbitTemplate.convertAndSend(destination,message);
    }
    //属性封装需求
    /*public void sendWithProps(T message, String destination, Properties properties) {
        rabbitTemplate.convertAndSend(destination, message, properties);
    }*/
}
